﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GestionaleLib
{
    public class Aliquota
    {
        public Guid Id { get; set; }
        public string Descrizione { get; set; }
        public double Valore { get; set; }

        public Aliquota()
        {
            Id = Guid.NewGuid();
        }
        public override string ToString()
        {
            return (Valore+"%").ToString();
        }
        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            if (Object.ReferenceEquals(this, obj)) return true;
            Aliquota Aliquota = obj as Aliquota;
            if ((System.Object)Aliquota == null)
            {
                return false;
            }
            if (Aliquota.Descrizione == this.Descrizione && Aliquota.Id == this.Id)
            {
                return true;
            }
            return false;
        }
    }
}
